home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 12
/
Mac Magazin and MacEasy Magazine CD - Issue 12.iso
/
Sharewarebibliothek
/
Anwendungen
/
Grafik
/
Matt's_Fract(Fat)101
/
Sources
/
includes
/
VideoVars.c
< prev
Wrap
C/C++ Source or Header
|
1995-06-26
|
3KB
|
183 lines
#include "AllTools.h"
short getCursorX(void)
{
return (* (short*) 0x083E);
}
short getCursorY(void)
{
return (* (short*) 0x083C);
}
void setCursorX(short mxValue)
{
(* (short*) 0x083E) = mxValue;
}
void setCursorY(short myValue)
{
(* (short*) 0x083C) = myValue;
}
videoInfo GetVideoInfo(void)
{
videoInfo theScreen;
short count;
theScreen.isVideo = TRUE;
theScreen.screenBase = GetScrnBase();
theScreen.resolutionX = GetScrnWidth();
theScreen.resolutionY = GetScrnHeight();
theScreen.rowBytes = GetScrnRowBytes();
theScreen.bitsPerPixel = GetScrnDepth();
theScreen.screenRect = GetScreenRect();
for (count = 0; count < 64; count ++)
{
theScreen.BitDepthPossible[count] = gotDepth(count);
}
return theScreen;
}
Ptr GetScrnBase(void)
{
GDHandle theGDHandle;
GDevice theGDDevice;
PixMapHandle thePixMapHandle;
PixMap thePixMap;
Ptr ScrnBase;
theGDHandle = GetTheGDevice();
theGDDevice = **(theGDHandle);
thePixMapHandle = theGDDevice.gdPMap;
thePixMap = **(thePixMapHandle);
ScrnBase = thePixMap.baseAddr;
return ScrnBase;
}
short GetScrnWidth(void)
{
GDHandle theGDHandle;
GDevice theGDDevice;
PixMapHandle thePixMapHandle;
PixMap thePixMap;
Rect theScreenRect;
short theWidth;
theGDHandle = GetTheGDevice();
theGDDevice = **(theGDHandle);
thePixMapHandle = theGDDevice.gdPMap;
thePixMap = **(thePixMapHandle);
theScreenRect = thePixMap.bounds;
theWidth = theScreenRect.right - theScreenRect.left;
return theWidth;
}
short GetScrnHeight(void)
{
GDHandle theGDHandle;
GDevice theGDDevice;
PixMapHandle thePixMapHandle;
PixMap thePixMap;
Rect theScreenRect;
short theHeight;
theGDHandle = GetTheGDevice();
theGDDevice = **(theGDHandle);
thePixMapHandle = theGDDevice.gdPMap;
thePixMap = **(thePixMapHandle);
theScreenRect = thePixMap.bounds;
theHeight = theScreenRect.bottom - theScreenRect.top;
return theHeight;
}
short GetScrnDepth(void)
{
GDHandle theGDHandle;
GDevice theGDDevice;
PixMapHandle thePixMapHandle;
PixMap thePixMap;
short theDepth;
theGDHandle = GetTheGDevice();
theGDDevice = **(theGDHandle);
thePixMapHandle = theGDDevice.gdPMap;
thePixMap = **(thePixMapHandle);
theDepth = thePixMap.pixelSize;
return theDepth;
}
Boolean gotDepth(short count)
{
GDHandle theGDHandle;
short theMode;
theGDHandle = GetTheGDevice();
theMode = HasDepth(theGDHandle, count, 1, 1);
return (theMode > 0);
}
short GetScrnRowBytes(void)
{
GDHandle theGDHandle;
GDevice theGDDevice;
PixMapHandle thePixMapHandle;
PixMap thePixMap;
short rowBytes;
theGDHandle = GetTheGDevice();
theGDDevice = **(theGDHandle);
thePixMapHandle = theGDDevice.gdPMap;
thePixMap = **(thePixMapHandle);
rowBytes = thePixMap.rowBytes;
rowBytes = (rowBytes & 4095);
return rowBytes;
}
unsigned char GetVolume(void)
{
return LMGetSdVolume();
}
void SetVolume(unsigned char SdVolumeValue)
{
LMSetSdVolume(SdVolumeValue);
}
StringPtr GetFinderName(void)
{
return LMGetFinderName();
}
void SetFinderName(StringPtr FinderNameValue)
{
LMSetFinderName(FinderNameValue);
}
Ptr GetTheA5(void)
{
return LMGetCurrentA5();
}
void SetTheA5(Ptr CurrentA5Value)
{
LMSetCurrentA5(CurrentA5Value);
}
GDHandle GetTheGDevice(void)
{
return LMGetTheGDevice();
}
Rect GetScreenRect(void)
{
return qd.screenBits.bounds;
}